GetEnumerator Method

Wintellect PowerCollections

Collapse imageExpand ImageCollapseAll imageExpandAll imageDropDown imageDropDownHover imageCopy imageCopyHover image
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Returns an enumerator that enumerates all the items in the set. The items are enumerated in sorted order.

Namespace: Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax

C#
public override sealed IEnumerator<T> GetEnumerator()
Visual Basic (Declaration)
Public Overrides NotOverridable Function GetEnumerator As IEnumerator(Of T)
Visual C++
public:
virtual IEnumerator<T>^ GetEnumerator () override sealed

Return Value

An enumerator for enumerating all the items in the Set.

Remarks

Typically, this method is not called directly. Instead the "foreach" statement is used to enumerate the items, which uses this method implicitly.

If an item is added to or deleted from the set while it is being enumerated, then the enumeration will end with an InvalidOperationException.

Enumerating all the items in the set takes time O(N), where N is the number of items in the set.

See Also